﻿<Application x:Class="MicroBlogClient.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:converter="clr-namespace:Rabbit.Converters;assembly=Rabbit.Converters"
             xmlns:theme="clr-namespace:Rabbit.Themes;assembly=Rabbit.Themes" 
             xmlns:controls="clr-namespace:Rabbit.Controls;assembly=Rabbit.Controls"
             Startup="Application_Startup" ShutdownMode="OnMainWindowClose"
             Exit="Application_Exit" DispatcherUnhandledException="Application_DispatcherUnhandledException"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <sys:String x:Key="AppTitle">微兔桌面微博2.1</sys:String>
            <sys:String x:Key="ConsumerKey">AYByrZSXj5uaFKytTomy</sys:String>
            <sys:String x:Key="ConsumerSecret">kSIld=0ET$nUtRsWjUr(tl2-Q1l#C0G04Rr3cdgn</sys:String>
            <sys:String x:Key="RequestTokenUrl">http://api.t.sohu.com/oauth/request_token</sys:String>
            <sys:String x:Key="AuthorizationTokenUrl">http://api.t.sohu.com/oauth/authorize</sys:String>
            <sys:String x:Key="AccessTokenUrl">http://api.t.sohu.com/oauth/access_token</sys:String>
            <sys:String x:Key="APIBaseUrl">http://api.t.sohu.com</sys:String>
            <sys:String x:Key="UserStatusServerUrl">http://weitwo.com/rabbitapi/</sys:String>
            
            <sys:String x:Key="AuthorWebSite">http://niuyuming.t.sohu.com</sys:String>
            <sys:String x:Key="StatusTextBoxHintText">现在想说点啥？</sys:String>
            <sys:String x:Key="FeedBackAuthor">@韩现龙</sys:String>
            <sys:Int64 x:Key="AuthorId">24311958</sys:Int64>
            <sys:String x:Key="UserBlogPrefix">http://t.sohu.com/u/</sys:String>
            <sys:String x:Key="StatusPrefix">http://t.sohu.com/m/</sys:String>
            <sys:String x:Key="RegisterPageUrl">http://t.sohu.com/reg/reg.jsp</sys:String>
            <sys:String x:Key="PasswordRecoveryPageUrl">http://passport.sohu.com/web/recover.jsp</sys:String>
            <sys:String x:Key="MyWebsite">http://weitwo.com</sys:String>
            
            <sys:Int32 x:Key="MaxStatusLength">140</sys:Int32>

            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
            <converter:ContrastBooleanToVisibilityConverter x:Key="ContrastBooleanToVisibilityConverter"/>
            <converter:ImageConverter x:Key="ImageConverter"/>
            <converter:StringToVisibilityConverter x:Key="StringToVisibilityConverter"/>
            <converter:DateTimeFormatConverter x:Key="DateTimeFormatConverter"/>
            <converter:MinusConverter x:Key="MinusConverter"/>
            <converter:GreaterThanConverter x:Key="GreaterThanConverter"/>
            <converter:LessThanOrEqualConverter x:Key="LessThanOrEqualConverter"/>
            <converter:IntegerGreaterThanToVisibilityConverter x:Key="IntegerGreaterThanToVisibilityConverter"/>
            <converter:BooleanToContrastConverter x:Key="BooleanToContrastConverter"/>

            <Style x:Key="HeadPictureBorderStyle" TargetType="Border" >
                <Setter Property="CornerRadius" Value="1"/>
                <Setter Property="Height" Value="48"/>
                <Setter Property="Width" Value="48"/>
                <Setter Property="Background">
                    <Setter.Value>
                         <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#ffffff" Offset="0"/>
                            <GradientStop Color="#bdbdbd" Offset="1"/>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="BorderThickness" Value="2"/>
                <Setter Property="BorderBrush">
                    <Setter.Value>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFBDBDBD" Offset="1"/>
                            <GradientStop Color="White"/>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="Grid" x:Key="PagerGridStyle">
                <Setter Property="Background" Value="{DynamicResource ButtonBackgroundLinearBrush}"/>
                <Setter Property="Height" Value="20"/>
            </Style>
            <Style TargetType="Button" x:Key="PagerButtonStyle">
                <Setter Property="Template" Value="{DynamicResource RoundCornerButtonTemplate}"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="BorderBrush" Value="#d4d8db"/>
                <Setter Property="Margin" Value="5,0,5,0"/>
                <Setter Property="Height" Value="18"/>
                <Setter Property="Cursor" Value="Hand"/>
                <Setter Property="FontSize" Value="8"/>
                <Setter Property="Padding" Value="5,0,5,0"/>
                <Setter Property="Background" Value="White"/>
                <Setter Property="VerticalContentAlignment" Value="Center"/>
                <Style.Triggers>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Background" Value="{x:Null}"/>
                        <Setter Property="BorderThickness" Value="0"/>
                        <Setter Property="Padding" Value="0"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
            <Style TargetType="Paragraph">
                <Setter Property="Margin" Value="0"/>
            </Style>
            
            <Style TargetType="controls:RichTextBoxEx">
                <Style.Resources>
                    <Storyboard x:Key="IncreaseHeight">
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.MinHeight)" >
                            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="120"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                    <Storyboard x:Key="DecreaseHeight">
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.MinHeight)" >
                            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="15"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </Style.Resources>
                <Setter Property="MinHeight" Value="15"/>
                <Setter Property="Margin" Value="5"/>
                <Setter Property="MaxHeight" Value="300"/>
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="Padding" Value="8"/> 
                <Style.Triggers>
                    <Trigger Property="HasContent" Value="true"> 
                        <Trigger.EnterActions>
                            <BeginStoryboard Storyboard="{StaticResource IncreaseHeight}" />
                        </Trigger.EnterActions>
                        <Trigger.ExitActions>
                            <BeginStoryboard Storyboard="{StaticResource DecreaseHeight}" />
                        </Trigger.ExitActions>
                    </Trigger>
                </Style.Triggers>
            </Style>

            <ControlTemplate x:Key="ButtonTemplate" TargetType="{x:Type Button}">
                <Border x:Name="ContentContainer" Height="{TemplateBinding Height}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"  Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                </Border>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="Background" Value="{DynamicResource ButtonBackgroundLinearRevertBrush}"/>
                    </Trigger>
                    <Trigger Property="IsPressed" Value="True">
                        <Setter Property="Padding" Value="0,2,0,0"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
           
            <ControlTemplate x:Key="StretchContentButtonTemplate" TargetType="{x:Type Button}">
                <Border x:Name="ContentContainer" Height="{TemplateBinding Height}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"  Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                    <ContentPresenter />
                </Border>
            </ControlTemplate>
           
            <ControlTemplate x:Key="RoundCornerButtonTemplate" TargetType="{x:Type Button}">
                <Border x:Name="ContentContainer" CornerRadius="3" Height="{TemplateBinding Height}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"  Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                </Border>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="Background" Value="{DynamicResource ButtonBackgroundLinearRevertBrush}"/>
                    </Trigger>
                    <Trigger Property="IsPressed" Value="True">
                        <Setter Property="Padding" Value="5,2,5,0"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            <ControlTemplate x:Key="RichTextBoxTemplate" TargetType="{x:Type TextBoxBase}">
                <StackPanel>
                    <Border x:Name="Bd" MinHeight="{TemplateBinding MinHeight}" BorderBrush="Gray" BorderThickness="1"  Background="{TemplateBinding Background}"  CornerRadius="5">
                        <ScrollViewer x:Name="PART_ContentHost"  MaxHeight="{TemplateBinding MaxHeight}"  
                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"  />
                    </Border>
                    <Polyline HorizontalAlignment="Right"
                              Margin="0,-1,15,0" 
                              Fill="White"
                              Stroke="Gray"
                              Height="8"
                              Width="20" Points="10,0 5,8 0,0" />
                </StackPanel>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsEnabled" Value="False">
                        <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            <Style x:Key="HotKeyTextBoxStyle" TargetType="TextBox">
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="HorizontalContentAlignment" Value="Center"/>
                <Setter Property="ToolTipService.InitialShowDelay" Value="0"/>
                <Setter Property="ToolTip" Value="直接按键盘设置"/>
                <Style.Triggers>
                    <Trigger Property="IsFocused" Value="true">
                        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                        <Setter Property="Foreground" Value="White"/>
                    </Trigger>
                    <Trigger Property="IsMouseOver" Value="true">
                        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                        <Setter Property="Foreground" Value="White"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
            <Style x:Key="FocusVisual">
                <Setter Property="Control.Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Rectangle Stroke="{x:Null}"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="Expander">
                <Setter Property="FocusVisualStyle" Value="{DynamicResource  FocusVisual}"/>
            </Style>

            <Style x:Key="ListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
                <Setter Property="FocusVisualStyle" Value="{DynamicResource  FocusVisual}"/>
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="OverridesDefaultStyle" Value="true" />
                <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
                <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
                <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
                <Setter Property="Padding" Value="0,0,0,0"/>

                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate  TargetType="{x:Type ListBoxItem}">
                            <Border x:Name="Bd" Margin="0"  CornerRadius="3" BorderThickness="0,0,0,1" BorderBrush="#d4d8db" Background="{TemplateBinding Background}" Padding="2" SnapsToDevicePixels="true">
                                <!--<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>-->
                                <ContentPresenter/>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="Background" TargetName="Bd" Value="#f6f6f6"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            
            <Style TargetType="ListBox">
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="ItemContainerStyle" Value="{DynamicResource ListBoxItemStyle}"/>
                <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
                <Setter Property="ScrollViewer.CanContentScroll" Value="False"/>
                <Setter Property="Margin" Value="0"/>
                <Setter Property="Foreground" Value="Black"/>
            </Style>

            

            <Style TargetType="TabControl">
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="Padding" Value="0"/>
            </Style>
            
            <Style x:Key="PictureViewerTitleBar" TargetType="{x:Type Canvas}">
                <Setter Property="Height" Value="20"/>
                <Setter Property="Panel.ZIndex" Value="1"/>
                <Setter Property="Background">
                    <Setter.Value>
                        <SolidColorBrush Color="Black" Opacity="0.5"/>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="PictureViewerFunctionTextStyle" TargetType="{x:Type TextBlock}">
                <Setter Property="Foreground" Value="White"/>
                <Setter Property="Cursor" Value="Hand"/>
                <Setter Property="FontSize" Value="11"/>
            </Style>

            <Style x:Key="PublishButtonStyle" TargetType="Button">
                <Setter Property="FocusVisualStyle" Value="{DynamicResource  FocusVisual}"/>
                <Setter Property="Background" Value="{DynamicResource PublishStatusButtonBackgroundBrush}"/>
                <Setter Property="Width" Value="65"/>
                <Setter Property="Height" Value="24"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Border x:Name="ContentContainer" CornerRadius="3" Height="{TemplateBinding Height}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"  Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="Background" Value="{DynamicResource ButtonBackgroundLinearRevertBrush}"/>
                                </Trigger>
                                <Trigger Property="IsPressed" Value="True">
                                    <Setter Property="Padding" Value="0,2,0,0"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="emotionTabItemStyle" TargetType="TabItem">
                <Setter Property="Foreground" Value="Black"/>
                <Setter Property="Padding" Value="6,1,6,1"/>
                <Setter Property="BorderBrush" Value="{x:Null}"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="Background" Value="{x:Null}"/>
                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabItem}">
                            <Grid SnapsToDevicePixels="true">
                                <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="3" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
                                    <ContentPresenter x:Name="Content"  ContentSource="Header" HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
                                </Border>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Background" TargetName="Bd" Value="#c6c9cc"/>
                                </Trigger>
                                <Trigger Property="IsSelected" Value="true">
                                    <Setter Property="Background" TargetName="Bd" Value="#c6c9cc"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="emotionStyle" TargetType="Border">
                <Setter Property="BorderBrush" Value="#ebeff0"/>
                <Setter Property="Height" Value="20"/>
                <Setter Property="Width" Value="20"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="BorderBrush" Value="#90acbd"/>
                        <Setter Property="BorderThickness" Value="1"/>
                        <Setter Property="Background" Value="#e4f1f9"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
            <Style x:Key="EmotionListBorderStyle" TargetType="Border">
                <Setter Property="BorderBrush" Value="#d4d8db"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="Background" Value="#fbfae9"/>
                <Setter Property="Height" Value="100"/>
                <Setter Property="Width" Value="307"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
            </Style>
             
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Rabbit.Themes;component/Default/theme.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>
